package com.ruoyi.feiyi.service.impl;

import java.util.Arrays;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.feiyi.mapper.FyChatUserMapper;
import com.ruoyi.feiyi.domain.FyChatUser;
import com.ruoyi.feiyi.service.IFyChatUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 大师互动Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-26
 */
@Service
public class FyChatUserServiceImpl extends ServiceImpl<FyChatUserMapper, FyChatUser> implements IFyChatUserService
{

    /**
     * 查询大师互动
     * 
     * @param id 大师互动主键
     * @return 大师互动
     */
    @Override
    public FyChatUser getInfoById(Long id)
    {
        return this.getById(id);
    }

    /**
     * 查询大师互动列表
     * 
     * @param fyChatUser 大师互动
     * @return 大师互动
     */
    @Override
    public List<FyChatUser> selectList(FyChatUser fyChatUser)
    {
        return baseMapper.selectList(fyChatUser);
    }

    /**
     * 新增大师互动
     * 
     * @param vo
     * @return 结果
     */
    @Override
    public int insertFyChatUser(FyChatUser vo)
    {
        vo.setCreateTime(DateUtils.getNowDate());
        this.save(vo);
        return 1;
    }

    /**
     * 修改大师互动
     * 
     * @param fyChatUser 大师互动
     * @return 结果
     */
    @Override
    public int updateFyChatUser(FyChatUser fyChatUser)
    {
        fyChatUser.setUpdateTime(DateUtils.getNowDate());
        this.updateById(fyChatUser);
        return 1;
    }

    /**
     * 批量删除大师互动
     * 
     * @param ids 需要删除的大师互动主键
     * @return 结果
     */
    @Override
    public int deleteFyChatUserByIds(String ids)
    {
        this.removeByIds(Arrays.asList(Convert.toStrArray(ids)));
        return 1;
    }

    /**
     * 删除大师互动信息
     * 
     * @param id 大师互动主键
     * @return 结果
     */
    @Override
    public int deleteFyChatUserById(Long id)
    {
        this.removeById(id);
        return 1;
    }
}
